package com.jt.demo10.service;

import com.jt.demo10.mapper.UserMapper;
import com.jt.demo10.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

//@Component  //给spring管理
//@Repository //持久层
@Service //业务层 对象交给spring容器管理：key:userServiceImpl value：反射对象
public class UserServiceImpl implements UserService{

    @Autowired //根据类型匹配，自动注入
    private UserMapper userMapper;


    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }
}
